<template>
  <view class='activity'>
    <!-- 活动 -->
    <u-mask :show="show">
      <view class="box">
        <view class="image">
          <view class="icon" @click.stop="show = false">
            <u-icon name="close" color="#d2cfcf" size="16"></u-icon>
          </view>
          <image :src="activityImage" mode="widthFix" @click.stop="skipUrl">
          </image>
        </view>
      </view>
    </u-mask>

  </view>
</template>

<script>
const $api = require('@/utils/request.js').API
export default {
  data() {
    return {
      show: false,
      activityImage: ''
    }
  },
  mounted() {
    this.getImage()
  },

  methods: {
    // 获取活动图片
    getImage() {
      $api.recommendRegister({}).then(res => {
        if (res.data.data.image) {
          this.activityImage = this.$image + res.data.data.image
          this.show = true
        }
      })
    },
    // 跳转到邀请页
    skipUrl() {
      this.show = false
      uni.navigateTo({
        url: '/pages_InviteMembers/InviteMembers/invite'
      })
    }

  }
}

</script>

<style scoped lang='scss'>
.activity {
  .box {
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;

    .image {
      position: relative;

      .icon {
        position: absolute;
        top: -10rpx;
        right: -10rpx;
        border: 1px solid #d2cfcf;
        border-radius: 50%;
        width: 18px;
        height: 18px;
        display: flex;
        align-items: center;
        justify-content: center;

      }

      image {
        width: 500rpx;
        height: 500rpx;
      }
    }
  }


}
</style>
